package com.it.zhangjun.design.pattern.chainOfResponsibility;

/**
 * @className: HolidayDiscountFilter
 * @description: 节日一律减5元
 * @author: z00018123
 * @date: 2021/4/29
 **/
public class HolidayDiscountFilter extends DiscountFilter {
    @Override
    protected int calculatePrice(int price) {
        System.out.println("节日一律减5元");
        price = price - 5;
        if (this.nextDiscountFilter != null) {
            return super.nextDiscountFilter.calculatePrice(price);
        }
        return price;
    }
}
